package user;

import operation.IOperation;
import operation.impl.BorrowOperation;
import operation.impl.DisplayOperation;
import operation.impl.FindOperation;
import operation.impl.ReturnOperation;

// 普通用户
public class NormalUser extends User {
    /**
     * 1.显示当前书籍列表
     * 2.查询书籍
     * 3.借阅书籍
     * 4.归还书籍
     * -1.退出
     * @param userName 用户名
     */
    public NormalUser(String userName) {
        this.name = userName;
        operations = new IOperation[] {
                new DisplayOperation(),
                new FindOperation(),
                new BorrowOperation(),
                new ReturnOperation()
        };
    }
    /**
     * 1.显示当前书籍列表
     * 2.查询书籍
     * 3.借阅书籍
     * 4.归还书籍
     * -1.退出
     * @return 选择
     */
    @Override
    public int menu() {
        System.out.println("======================================");
        System.out.println("欢迎"+this.name+"登录图书馆管理系统");
        System.out.println("1.显示当前书籍列表");
        System.out.println("2.查询书籍");
        System.out.println("3.借阅书籍");
        System.out.println("4.归还书籍");
        System.out.println("-1.退出");
        System.out.println("请输入您的选择:");
        return scanner.nextInt();
    }
}
